package cn.kgc.service.impl;

import cn.kgc.dao.UserMapper;
import cn.kgc.pojo.Role;
import cn.kgc.pojo.User;
import cn.kgc.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User login(String userCode, String password) {
        return userMapper.login(userCode, password);
    }

    @Override
    public List<User> queryAllUser(String userName, String userType) {
        return userMapper.queryAllUser(userName, userType);
    }

    @Override
    public Integer upDateUser(User user) {
        return userMapper.upDateUser(user);
    }

    @Override
    public User queryByIdUser(Integer id) {
        return userMapper.queryByIdUser(id);
    }

    @Override
    public List<User> queryOftenUser() {
        return userMapper.queryOftenUser();
    }

    @Override
    public Integer deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public Integer addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public List<Role> queryRole(Integer roleId) {
        return userMapper.queryRole(roleId);
    }

}
